import request from "../../utils/request";
import { getUser } from "../admin/User";
export function A() {
    return request({
        url: '/admin/employee/List',
        method: 'get'
    })
}




export function getCartList() {
    return request({
        url: 'user/UserCart/List',
        method: 'get',
    })
}


export function ShowCommodity() {
    return request({
        url: 'user/UserCart/ShowCommodity',
        method: 'get',
        params: {
            goodsId: getgoodsId()
        }
    })
}


export function addShoppingcar(goodsId) {
    return request({
        url: 'user/UserCart/AddShoppingCar',
        method: 'post',
        params: {
            goodsId: goodsId,
        }
    })
}
export function checkout(submitForm) {
    return request({
        url: '/user/UserCart/checkout',
        method: 'post',
        params: submitForm
    })
}
export function batchDeleteItems(ids) {
    return request({
        url: '/user/UserCart/batchDeleteItems',
        method: 'delete',
        params: {
            ids: ids.join(',') // 转换为逗号分隔字符串
        }
    })
}

export function setgoodsId(goodsId) {
    localStorage.setItem("goodsId", goodsId)
}

export function getgoodsId() {
    return localStorage.getItem("goodsId")
}